Back to Contents        Previous        Next








15. JPEG files

FNwimp_measurefile(filepath$,warning%)
Returns the size in bytes needed to store a file in memory prior to using FNwimp_loadfile(), FNwimp_loaddfile(), FNwimp_loadsprites() or FNwimp_loadjpegfile().
Returns -1 if filepath$ not found.
Always use this as opposed to any other form of measurement.
filepath$ = full pathname of sprite­file.
warning% - if not 0, a non-fatal warning will be given if filepath$ cannot be found.
(This function is also listed in in other sections)

FNwimp_loadjpegfile(filepath$,address%,warning%)
Loads a JPEG file into a block of memory at address%.
The memory block must have already been created after using FNwimp_measurefile().
Returns the address (handle) at which to load the next file (if any) into the same memory block. (If filepath$ cannot be found the return will be the value of address% i.e. memory not used.)
filepath$ = full pathname of JPEG file.
warning% - if not 0, a non-fatal warning will be given if filepath$ cannot be found.


FNwimp_getjpegsize(jpeghandle%,side%,dpi90%)
Returns the width/height (in OS units) of the overall ‘bounding box’ surrounding a JPEG graphic which has been loaded into memory using FNwimp_loadjpegfile().
jpeghandle%= JPEG file handle.
If side% = 0 returns width.
If side% = 1 returns height.
If dpi90%=0 then the natural dimensions are returned.
If dpi90%=1 then the dimensions are those for display at 90dpi.


FNwimp_getjpegsizefile(filepath$,side%,dpi90%,warning%)
Returns the width/height (in OS units) of the overall ‘bounding box’ surrounding a JPEG graphic directly from its file. (Returns 0 if filepath$ cannot be found.)
filepath$ = full JPEG file path.
If side% = 0 returns width.
If side% = 1 returns height.
If dpi90%=0 then the natural dimensions are returned.
If dpi90%=1 then the dimensions are those for display at 90dpi.
warning% - if not 0, a non-fatal warning will be given if filepath$ cannot be found.


PROCwimp_savejpeg(savepath$,jpeghandle%)
Saves a JPEG currently loaded in memory to a file. The JPEG must have been loaded into memory by FNwimp_loadjpegfile.
savepath$ = full pathname of file to be saved.
jpeghandle% = handle of memory area containing the JPEG.



PROCwimp_renderjpeg(jpeghandle%,bx%,by%,minx%,miny%,maxx%,m-axy%,scalex,scaley)
Renders (draws) a JPEG at the specified screen coordinates, using a clipping rectangle. All coordinates are in OS units.
The JPEG must already have been loaded into memory using
FNwimp_loadjpegfile().
jpeghandle% = handle of JPEG
bx%,by% = screen coordinates of where to put bottom left corner of JPEG.
minx%,miny% = screen coordinates of bottom left corner of clipping rectangle.
maxx%,maxy% = screen coordinates of top right corner of clipping rectangle.
(Clipping rectangle is the same as that passed to PROCuser_redraw.)
scalex,scaley = respectively, required scaling factors in x and y directions. Values <1 reduce displayed size; values >1 increase size.
(1 meaning no change in size).



PROCwimp_renderwindowjpeg(window%,jpeghandle%,bx%,by%,minx%-,miny%,maxx%,maxy%,scalex,scaley)
Renders (draws) a JPEG in a window at the specified work area coordinates, using a clipping rectangle. The window must have its
auto-redraw flag unset. All coordinates are in OS units.
The JPEG must already have been loaded into memory using
FNwimp_loadjpegfile().
window% = handle of window.
jpeghandle% = handle of JPEG
bx%,by% = work area coordinates of where to put bottom left corner of JPEG.
minx%,miny% = screen coordinates of bottom left corner of clipping rectangle.
maxx%,maxy% = screen coordinates of top right corner of clipping rectangle.
(Clipping rectangle is the same as that passed to PROCuser_redraw.)
scalex,scaley = respectively, required scaling factors in x and y directions. Values <1 reduce displayed size; values >1 increase size.
(1 meaning no change in size).



PROCwimp_renderjpegfile(jpegfilepath$,bx%,by%,minx%,miny%,maxx-%,maxy%,scalex,scaley,warning%)
Renders (draws) a JPEG directly from its file to the specified screen coordinates, using a clipping rectangle. All coordinates are in OS units.
jpegfilepath$ = fullpath of JPEG file
bx%,by% = screen coordinates of where to put bottom left corner of JPEG.
minx%,miny% = screen coordinates of bottom left corner of clipping rectangle.
maxx%,maxy% = screen coordinates of top right corner of clipping rectangle.
(Clipping rectangle is the same as that passed to PROCuser_redraw.)
scalex,scaley = respectively, required scaling factors in x and y directions. Values <1 reduce displayed size; values >1 increase size.
(1 meaning no change in size).
warning% - if not 0, a non-fatal warning will be given if jpegfilepath$ cannot be found.
(Note: This function cannot be used for printing.)



PROCwimp_renderwindowjpegfile(window%,jpegfilepath$,bx%,by%,min-x%,miny%,maxx%,maxy%,scalex,scaley,warning%)
Renders (draws) a JPEG directly from its file to a window at the specified work area coordinates, using a clipping rectangle. The window must have its auto-redraw flag unset.
All coordinates are in OS units.
window% = handle of window.
jpegfilepath$ = fullpath of JPEG file
bx%,by% = work area coordinates of where to put bottom left corner of JPEG.
minx%,miny% = screen coordinates of bottom left corner of clipping rectangle.
maxx%,maxy% = screen coordinates of top right corner of clipping rectangle.
(Clipping rectangle is the same as that passed to PROCuser_redraw.)
scalex,scaley = respectively, required scaling factors in x and y directions. Values <1 reduce displayed size; values >1 increase size.
(1 meaning no change in size).
warning% - if not 0, a non-fatal warning will be given if jpegfilepath$ cannot be found.

(Note: This function cannot be used for printing.)






Top of page        Back to Contents        Previous        Next